package com.cloudpolice.door.dao;

import com.cloudpolice.door.dto.FaceLogDTO;
import com.cloudpolice.door.model.FaceLogRecordMainModel;
import com.cloudpolice.door.model.InPutParam.FaceLogBaseInsertInParam;
import com.cloudpolice.door.model.InPutParam.FaceLogInsertInParam;
import com.cloudpolice.door.model.InPutParam.FaceLogSelectInParam;
import com.cloudpolice.door.model.InPutParam.FaceLogSubInsertInParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ：梁昊，后端工程师：flyman5，前端工程师：孙耀
 * @create 2020-02-28 12:17
 * @function
 * @editLog
 */
@Mapper
public interface FaceLogMapper {
    /**
     * 得到门禁机抓拍记录根据
     *
     * @param personId 人员ID（居民，物业人员，警务人员)
     * @return 抓拍记录
     */
    List<FaceLogRecordMainModel> SelectFaceLogByPersonId(@Param("personId") String personId);

    /**
     * 更新门禁记录关联信息（MQ接收端）
     *
     * @param faceLogInsertInParam com.cloudpolice.door.model.InPutParam.FaceLogInsertInParam
     * @return 影响条数
     */
    int updateFaceLogById(FaceLogInsertInParam faceLogInsertInParam);

    /**
     * 增加门禁从表记录（MQ接收端）
     *
     * @param faceLogSubInsertInParam com.cloudpolice.door.model.InPutParam.FaceLogSubInsertInParam
     * @return 影响条数
     */
    int insertAllFaceSubLog(FaceLogSubInsertInParam faceLogSubInsertInParam);

    /**
     * 增加门禁记录（MQ接收端）
     *
     * @param faceLogBaseInsertInParam com.cloudpolice.door.model.InPutParam.FaceLogBaseInsertInParam
     * @return 影响条数
     */
    int insertAllFaceLog(FaceLogBaseInsertInParam faceLogBaseInsertInParam);

    /**
     * 根据ID查询开门记录
     *
     * @param id 主键
     * @return 开门记录
     */
    FaceLogInsertInParam selectFaceLogById(@Param("id") String id);

    /**
     * 根据相关参数查询开门记录
     *
     * @param faceLogSelectInParam 输入参数
     * @return 根据相关参数查询开门记录
     */
    List<FaceLogDTO> selectFaceLogsByParam(FaceLogSelectInParam faceLogSelectInParam);
}
